<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/6/21
 * Time: 下午1:58
 */

namespace app\index\model;


use think\Model;

class UrlTag extends Model
{
    protected $table = "t_urltag";
    public static function getAll(){
        $data = self::where("flag","=",1)->select();
        if($data->isEmpty()){
            return[];
        }

        $tag_list = [];
        foreach ($data as $item){
            $tag_item["id"] = $item["id"];
            $tag_item["name"] = $item["name"];
            array_push($tag_list,$tag_item);
        }
        return $tag_list;
    }
}